<%@ page import="java.util.List" %>
<%@ page import="com.itany.ums.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    .container{
      width: 70%;
      margin: 0 auto;
      padding: 20px;
    }
    table{
      width: 100%;
      margin-top: 20px;
      text-align: center;
    }
    a{
      text-decoration: none;
      color: blue;
      font-weight: bold;
    }
  </style>
</head>
<body>
  <div class="container">
    <a href="">添加用户</a>
    <table border="1px" cellpadding="0" cellspacing="0">
      <thead>
        <tr>
          <th>序号</th>
          <th>姓名</th>
          <th>密码</th>
          <th>年龄</th>
          <th>性别</th>
          <th>简介</th>
          <th>爱好</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <%
          Object data = request.getAttribute("users");
          if (data == null){
              return;
          }
            List<User> users = (List<User>) data;
          for(User u : users){
        %>
          <tr>
            <td><%=u.getId()%></td>
            <td><%=u.getName() %></td>
            <td><%=u.getPwd() %></td>
            <td><%=u.getAge() %></td>
            <td><%=u.getSex() %></td>
            <td><%=u.getInfo() %></td>
            <td><%=u.getHobby() %></td>
            <td>
              <a href="">删除</a>
              <a href="">修改</a>
            </td>
          </tr>

        <%
          }
        %>
      </tbody>
    </table>
  </div>
</body>
</html>